/**
 * @projectName: project02bywdmtz
 * @package: com.cskaoyan.controller
 * @className: StatController
 * @author: 冉夏
 * @description: TODO
 * @date: 2022/12/30 8:58
 * @version: 1.8
 */

package com.cskaoyan.controller;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.StatGoodsVo;
import com.cskaoyan.bean.vo.StatOrderVo;
import com.cskaoyan.bean.vo.StatUserVo;
import com.cskaoyan.service.StatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
* 该模块是统计模块,用于统计用户,订单,信息
* */
@RequestMapping("admin/stat")
@RestController
public class StatController {
    @Autowired
    StatService statService;
    /*
    * 统计user的注册时间
    * */
    @GetMapping("user")
    public BaseRespVo statUser(){
        StatUserVo statUserVo =statService.statUserNumByRegisTime();
        return BaseRespVo.ok(statUserVo);
    }
    /*
    * 获得订单的统计信息
    * */
    @GetMapping("order")
    public BaseRespVo statOrder(){
        StatOrderVo statOrderVo=statService.getStatOrderInfo();
        return BaseRespVo.ok(statOrderVo);
    }
    /*
    * 获取商品的统计信息
    * */
    @GetMapping("goods")
    public BaseRespVo statGoods(){
        StatGoodsVo statGoodsVo=statService.getStatGoodsInfo();
        return BaseRespVo.ok(statGoodsVo);

    }



}
